package com.zhuhjay.framework.security;

import com.zhuhjay.common.security.UserInfo;
import com.zhuhjay.service.system.model.entity.SystemUser;
import lombok.Data;

/**
 * 具体的用户信息, 将业务中的用户信息存入
 *
 * @author ZhuHJay
 * @date 2023/8/3 23:54
 */
@Data
public class SpecificUserInfo implements UserInfo {

    private Integer id;
    private String username;
    private String password;

    public SpecificUserInfo(SystemUser user) {
        this.id = user.getId();
        this.username = user.getUsername();
        this.password = user.getPassword();
    }

    public static SpecificUserInfo of(SystemUser user) {
        return new SpecificUserInfo(user);
    }
}
